<me:UIGPDAT x:Class="WPFExcelReport.TGB33SM"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:GS="clr-namespace:WPFExcelReport;assembly=TGSDAT"  
                    xmlns:GSC="clr-namespace:WPFExcelReport;assembly=TGSCOLOR"
            xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
            xmlns:QP="clr-namespace:WPFExcelReport;assembly=TQPPLAN"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIGPDAT.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/> 
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>  
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:Divideby100 x:Key="d100"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NDateConverter x:Key="date"/>
    </me:UIGPDAT.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Background="{StaticResource QueryZoneBrush}">
      
            <WrapPanel Visibility="Collapsed"> 
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" >色棉库</TextBlock>
                    <ex:TXT72 MaxLength="2" PRE="  " Grid.Column="1"  FontSize="18" Foreground="Red"   Text="{Binding LO}" Width="30"/>
                    <ex:TXT72 MaxLength="2" PRE="  " Grid.Column="2"  FontSize="18" Foreground="Red"   Text="{Binding LB}" Width="30"/>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>

                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色棉:}}"></TextBlock>
                    <GS:TSGS02  Grid.Column="1" Name="cGS02" KRS="{Binding ART,ElementName=TV}" ART="{Binding ART,ElementName=TV}"/>
                    <ex:TXT72   Grid.Column="2" CharacterCasing="Upper" Text="{Binding ART}" Width="100" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>

                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                    <GSC:TSGS06  Grid.Column="1" GSART="{Binding KEY,ElementName=cGS02}" KEY="{Binding FARBE,ElementName=TV}"/>
                    <ex:TXT72 MaxLength="10" Grid.Column="2" CharacterCasing="Upper" Text="{Binding FARBE}" Width="60" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=系统批次:}}"></TextBlock>
                    <me:TSGP02  Grid.Column="1" GSART="{Binding KEY,ElementName=cGS02}" KEY="{Binding GPPARTIE,ElementName=TV}"/>
                    <ex:TXT72  Grid.Column="2" MaxLength="8" PRE="00000000" CharacterCasing="Upper" Text="{Binding GPPARTIE,Converter={StaticResource gb2312}}" Width="60" /> 
                </Grid>
            </WrapPanel>
            <WrapPanel Visibility="Collapsed">
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=纺批:}}"></TextBlock>
                    <me:TSSP  Grid.Column="1" GSART="{Binding KEY,ElementName=cGS02}" KEY="{Binding GPSPPART,ElementName=TV}"/>
                    <ex:TXT72 MaxLength="10" Grid.Column="2" CharacterCasing="Upper" Text="{Binding GPSPPART, Converter={StaticResource gb2312}}" Width="100" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=染批:}}"></TextBlock>
                    <me:TSFP  Grid.Column="1" GSART="{Binding KEY,ElementName=cGS02}" KEY="{Binding GPFBPART,ElementName=TV}"/>
                    <ex:TXT72 MaxLength="10" Grid.Column="2" CharacterCasing="Upper" Text="{Binding GPFBPART, Converter={StaticResource gb2312}}" Width="100" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Visibility="Collapsed" Grid.Column="0" Text="{Binding Source={Localization:Translate Word=捻批:}}"></TextBlock>
                    <me:TSTP Visibility="Collapsed" Grid.Column="1" GSART="{Binding KEY,ElementName=cGS02}" KEY="{Binding GPZWPART,ElementName=TV}"/>
                    <ex:TXT72 Visibility="Collapsed" MaxLength="10" Grid.Column="2" CharacterCasing="Upper" Text="{Binding GPZWPART, Converter={StaticResource gb2312}}" Width="100" />
                </Grid> 
            </WrapPanel>
            <WrapPanel>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button  Click="QueryCommand" Background="White" KeyUp="Query_KeyUp"  Content="{Binding Source={Localization:Translate Word=查询}}" FontSize="20" Height="30" Margin="5,0,0,0" Width="Auto" > 
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="EditCommand" Background="Pink" Content="{Binding Source={Localization:Translate Word=修改}}" FontSize="20" Width="Auto" Height="30"> 
                    </Button>
                    
                </Grid>
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <DR:TDRAUFTR  Grid.Column="0" Name="cDR" DocType="{Binding QCDOCTYP,ElementName=TV}" PrintType="OpenExcel" />
                    <Button  Click="PrintCommand"  Background="Pink" Content="{Binding Source={Localization:Translate Word=导出}}" FontSize="20" Width="Auto" Height="30">
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="SaveCommand" Content="{Binding Source={Localization:Translate Word=保存}}" FontSize="20" Height="30" Margin="5,0,0,0" Width="Auto" > 
                    </Button>
                </Grid>
                <WrapPanel >
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>

                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Height="20" Width="40" FontSize="16" Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                        <TextBox Background="White" Height="30" FontSize="20" MaxLength="10" Grid.Column="2" KeyUp="Query_KeyUp" CharacterCasing="Upper" Text="{Binding FARBE,ElementName=TV}" Width="120" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Height="20" Width="40" FontSize="16" Text="{Binding Source={Localization:Translate Word=纺批:}}"></TextBlock>
                        <TextBox MaxLength="10" Grid.Column="2" Background="White" FontSize="20" CharacterCasing="Upper" KeyUp="Query_KeyUp" Text="{Binding GPSPPART,ElementName=TV, Converter={StaticResource gb2312}}" Width="140" />
                    </Grid>
                    <Grid Visibility="Collapsed" Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Height="20" Width="40" FontSize="16" Text="{Binding Source={Localization:Translate Word=染批:}}"></TextBlock>
                        <ex:TXT72 MaxLength="10" Grid.Column="2" FontSize="20" CharacterCasing="Upper" KeyUp="Query_KeyUp" Text="{Binding GPFBPART,ElementName=TV, Converter={StaticResource gb2312}}" Width="140" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0"  FontSize="16" Text="{Binding Source={Localization:Translate Word=包含已质检:}}"></TextBlock>
                        <CheckBox  Grid.Column="1"  IsChecked="{Binding Checked,ElementName=TV}" ></CheckBox>
                    </Grid>
                    <TextBlock FontSize="16" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=检验日期}}"></TextBlock>
                    <DatePicker Height="30" Grid.Column="1" HorizontalAlignment="Left" Margin="5,0,0,0"   
                            Text="{Binding DTSTART,ElementName=TV, Converter={StaticResource date}}" FontSize="18" SelectedDateChanged ="DTSTART_SelectedDateChanged"  Width="140" 
                                DisplayDate="{Binding DTSTART,ElementName=TV, Converter={StaticResource date}}"/>
                    <Label Content="{Binding Source={Localization:Translate Word=到}}"  Grid.Column="2" Height="28" HorizontalAlignment="Left" Margin="10,0,0,0"   Width="Auto" FontSize="18" />
                    <DatePicker Height="30"  Grid.Column="3" HorizontalAlignment="Left" Margin="5,0,0,0"   VerticalAlignment="Center" 
                                  Text="{Binding DTEND,ElementName=TV,Converter={StaticResource date}}"  FontSize="18"  
                                 DisplayDate="{Binding DTEND,ElementName=TV, Converter={StaticResource date}}"
                                SelectedDateChanged ="DTEND_SelectedDateChanged" Width="140" />
                </WrapPanel> 
            </WrapPanel>
        </StackPanel>
        <Border Grid.Row="1" BorderThickness="2,2,0,0" BorderBrush="{StaticResource BorderBrush}">
          <DataGrid  Grid.Row="1"  
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                   x:Name="dlgMaster" 
                   RowDetailsVisibilityMode="Visible"  
                >
                <DataGrid.Columns>
                    <DataGridTextColumn   Binding="{Binding Path=GPNEUDAT }" Header="{Binding Source={Localization:Translate Word=入库日期}}"  Width="Auto" IsReadOnly="True" />
                    <DataGridTextColumn   Binding="{Binding Path=QOKNEUD }" Header="{Binding Source={Localization:Translate Word=检测日期}}"  Width="Auto" IsReadOnly="True" /> 
                    <DataGridTextColumn Binding="{Binding Path=QOKORDER, Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=质检单}}"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GPGART, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=纱线}}"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GPSPPART, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=纺批}}"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GPFBPART, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=染批}}"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GPGFARBE, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=色号}}"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Visibility="Collapsed" Binding="{Binding Path=GPSPPART, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=纺批}}"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=S001, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=回潮率}}"  Width="46" />
                    <DataGridTextColumn Binding="{Binding Path=S002, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=马克隆值}}"  Width="60" /> 
                    <DataGridTextColumn Binding="{Binding Path=S003,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=断裂比强度（cN/tex）}}"  Width="130" />
                    <DataGridTextColumn Binding="{Binding Path=S004,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=上半部平均长度(mm)}}"  Width="130" />
                    <DataGridTextColumn Binding="{Binding Path=S005,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=棉结（粒/g）}}"  Width="80" />
                    <DataGridTextColumn Binding="{Binding Path=S006,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=颜色评语}}"  Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=S007,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=颜色级别}}"  Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=S008,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=颜色结论}}"  Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=S009,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=颜色均匀性评语}}"  Width="95" />
                    <DataGridTextColumn Binding="{Binding Path=S010,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=颜色均匀性结论}}"  Width="95" />
                    <DataGridTextColumn Binding="{Binding Path=S011,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=色牢度级别}}"  Width="70" />
                    <DataGridTextColumn Binding="{Binding Path=S012,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=色牢度结论}}"  Width="70" />
                    <DataGridTextColumn Binding="{Binding Path=S013,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=备注}}"  Width="60" />
                    <DataGridTextColumn Visibility="Collapsed" Binding="{Binding Path=GPPARTIE, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=批次}}"  IsReadOnly="True" Width="Auto" /> 
                    <DataGridTextColumn  Visibility="Collapsed" Binding="{Binding Path=GPZWPART, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=捻批}}"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Visibility="Collapsed" Binding="{Binding Path=GPBEM1, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=备注1}}"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Visibility="Collapsed" Binding="{Binding Path=GPBEM2, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=备注2}}" IsReadOnly="True"  Width="Auto" />
                    <DataGridTextColumn Visibility="Collapsed" Binding="{Binding Path=GPAENDBEN}" Header="{Binding Source={Localization:Translate Word=修改}}"  Width="Auto" IsReadOnly="True"/>
                    <DataGridTextColumn Visibility="Collapsed" Binding="{Binding Path=GPAENDDAT}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" IsReadOnly="True"/>
                    <DataGridTextColumn Visibility="Collapsed" Binding="{Binding Path=GPNEUBEN }" Header="{Binding Source={Localization:Translate Word=创建}}"  Width="Auto" IsReadOnly="True" /> 
                </DataGrid.Columns>
            </DataGrid  >         
        </Border>
        <QP:UQP Grid.Row="2" QPLAN="{Binding QPKEY,ElementName=TV}"
                     Name="cUDP"
                     />
     </Grid>
</me:UIGPDAT>
